package com.tjbklx1.zk.zookeeper.createSession;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.Watcher.Event.KeeperState;

public class MyWatcher implements Watcher {

	@Override
	public void process(WatchedEvent event) {
		System.out.println("watcher event = " + event);

		if (event.getState().equals(KeeperState.SyncConnected)) {
			doSomething();
		}
	}

	private void doSomething() {
		System.out.println("doSomethings");
	}

}
